import React from "react";

export interface HospitalListItem {
  id?: number;
  createTime?: string;
  updateTime?: string;
  isDeleted?: number;
  param?: object;
  hosname: string;
  hoscode: string;
  apiUrl: string;
  signKey: string;
  contactsName: string;
  contactsPhone: string;
  status?: number;
}

export type HospitalList = HospitalListItem[];

export interface ResHospitalType {
  records: HospitalList;
  total: number;
}

// =============医院列表相关

export interface ProvinceItem {
  id: number;
  createTime: string;
  updateTime: string;
  isDeleted: number;
  param: object;
  parentId: number;
  name: string;
  value: string;
  dictCode: null;
  hasChildren: boolean;
}

export type ProvinceList = ProvinceItem[];

export interface BookingRuleItem {
  cycle: number;
  releaseTime: string;
  stopTime: string;
  quitDay: number;
  quitTime: string;
  rule: string[];
}

export interface ContentItem {
  id: number;
  createTime: string;
  updateTime: string;
  isDeleted: number;
  param: {
    hostypeString: string;
    fullAddress: string;
  };
  hoscode: string;
  hosname: string;
  hostype: string;
  status: number;
  provinceCode: string;
  cityCode: string;
  districtCode: string;
  address: string;
  logoData?: string;
  intro: string;
  route: string;
  bookingRule?: BookingRuleItem;
}

export type ContentList = ContentItem[];

export interface ReqHospitalPageType {
  content: ContentList;
  totalElements: number;
}

export interface SearchParams {
  hoscode: string;
  hosname: string;
  hostype: string;
  provinceCode: string;
  cityCode: string;
  districtCode: string;
  status: number;
}

export interface HospitalDetail {
  hospital: ContentItem;
  bookingRule: BookingRuleItem;
}

export interface DepartmentsItem {
  depcode: string;
  depname: string;
  children: DepartmentsList;
}

export type DepartmentsList = DepartmentsItem[];

// ========================= 医院排班相关

export interface ReqGetScheduleRulesParams {
  page: number;
  limit: number;
  hoscode: string;
  depcode: React.Key;
}

export interface BookingScheduleItem {
  workDate: string;
  workDateMd: null;
  dayOfWeek: string;
  docCount: number;
  reservedNumber: number;
  availableNumber: number;
  status: number;
}

export type BookingScheduleList = BookingScheduleItem[];

export interface ReqScheduleRules {
  total: number;
  bookingScheduleList: BookingScheduleList;
  baseMap: {
    hosname: string;
  };
}

export interface ScheduleItem {
  param: {
    dayOfWeek: string;
    depname: string;
    hosname: string;
  };
  title: string;
  skill: string;
  workDate: string;
  reservedNumber: number;
  availableNumber: number;
  amount: number;
}

export type ScheduleList = ScheduleItem[];
